package ai.zixing.powermock.mockskip.domain;

import com.github.jsonzou.jmockdata.JMockData;
import com.github.jsonzou.jmockdata.MockConfig;


/**
 * @author zixing
 */
public class User {

    private String name;

    private int age;

    private String mail;

    public static User initUser() {
        MockConfig mockConfig = MockConfig.newInstance()
                // 年龄设置为 【1, 100】
                .subConfig(User.class, "age")
                .intRange(1, 14)
                // 用户名规则
                .subConfig(User.class, "name")
                .stringRegex("[a-zA-Z]{4,6}")
                .globalConfig();
        return JMockData.mock(User.class, mockConfig);
    }

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public User() {
    }

//    public void use() {
//        System.out.println("KKKKKKKKKKKKKKKKKKKKKKKKKKK");
//    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
